import java.util.*;
import java.sql.Timestamp;

import java.util.Vector;

public class MailRemind {
	static Vector<Timestamp> time;
	
	MailRemind() throws Exception{
		time = new Vector<Timestamp>();
		//DatabaseCtrl.close();
		DatabaseCtrl.init();
		time = DatabaseCtrl.getDetailTimestampMail();
	}
	
	public static void main(String[] args) {
		long tNow = System.currentTimeMillis();
		for(Timestamp x:time) {
			long t = x.getTime();
			if(t-tNow<=30*1000 && t-tNow>=0) {
				//�����ʼ�
				SendEmail mySend = new SendEmail(x);
				try {
					mySend.main(null);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			}
		}	
	}

}